<template>
  <view class="newaddress-content">
    <view class="newaddress-content-head" v-for="(item,index) in lists" :key="index">
      <text>{{item.type}}</text><input class="newaddress-content-head-input" v-model="item.value" type="text">
    </view>
    <button class="address-btn" @click="newAddress">新建地址</button>
  </view>
</template>

<style scoped>
  .address-btn {
    width: 100%;
    background-color: #fe7200;
    position: fixed;
    bottom: 0;
    border-radius:0;
    color: #fff;
  }
</style>
<script>
export default {
   data(){
    return{
      lists:[
        {
          type:'收货人',
          value:this.$store.state.value
        },
        {
          type:'手机号码',
          value:this.$store.state.value
        },
        {
          type:'所在地区',
          value:this.$store.state.value
        },
        {
          type:'详细地址',
          value:this.$store.state.value
        }
      ]
    }
  },
  onShow(){
    this.lists = this.$store.state.lists
  },
  methods:{
    newAddress(){
      uni.navigateTo({
        url:'newaddress'
      })
    }
  }
}
</script>
<style scoped>
  .newaddress-content{
    width: 100%;
    display: flex;
    flex-direction: column;
  }
  .newaddress-content-head {
  position: relative;
  width: 100%;
  display: flex;
  margin-left: 40rpx;
  align-items: center;
  color: #bbb;
  }
  .newaddress-content-head-input {
    width: 70%;
    height: 100rpx;
    margin-left:30rpx;
    font-size: 18px;
  }
</style>